﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
    <head>
    <title>Insert Flv</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="../../dialog/common/fck_dialog_common.js" type="text/javascript"></script>
    <link href="../../dialog/common/fck_dialog_common.css" type="text/css" rel="stylesheet">
    <script type="text/javascript">
 
        var dialog = window.parent;
        var oEditor = dialog.InnerDialogLoaded();
        var FCKLang = oEditor.FCKLang;
        window.onload = function() {
            // First of all, translate the dialog box texts
            oEditor.FCKLanguageManager.TranslatePage(document);


            // Show the "Ok" button.
            dialog.SetOkButton(true);

            // Select text field on load.
            SelectField('txtMusicUrl');

        }

        function Validate(s) {
            var patrn = /^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\’:+!]*([^<>\"\"])*$/;
            if (!patrn.exec(s)) {
                return false;
            }
            else {
                return true;
            }
        }

        function Ok() 
        {
            var sMusicUrl = GetE('txtMusicUrl').value;
            var link = GetE("videoLink").value;
            if (!Validate(sMusicUrl)) {
                alert("视频URL错误");
                return false;
            }
            var height = GetE("height").value;
            var width = GetE("weight").value;
            var flashvars;
            flashvars = "file=" + sMusicUrl;
            if (link != "") {
                if (!Validate(link)) {
                    alert("视频链接错误");
                    return false;
                }
                flashvars = flashvars+"&link=" + link;
            }
            var str = self.location.pathname.split("/");
            if ( sMusicUrl.length == 0 ) 
            { 
                alert("路径不能为空") ; 
                return false ; 
            }
            var sMusicHtml; //这里mp3player.swf请使用你的mp3player.swf的绝对路径
            sMusicHtml = '<embed src="images/player.swf" width="'+width+'" height="'+height+'" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="'+flashvars+'"/>';

            oEditor.FCK.InsertHtml(sMusicHtml);
            return true ; 
        } 
    </script>
    </head>
    <body style="overflow: hidden">
	<table height="100%" width="100%">
		<tr>
			<td align="center">
				<table border="0" cellpadding="0" cellspacing="0" width="80%">
					<tr>
						<td colspan="2"> <span>视频URL：填写FLV视频的绝对地址</span><br />
							例：http://www.xxx.com/video/xxx.flv
							<input id="txtMusicUrl" style="width: 100%;" type="text" />
							<span>链接URL：</span><br />
							<input id="videoLink" style="width: 100%;" type="text" />
						</td>
					</tr>
					<tr>
						<td >宽度:
							<input id="weight" type="text" style="width: 50%;" value="480" />
							px</td>
						<td >高度:
							<input id="height" type="text" style="width: 50%;" value="380" />
							px</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>
